package com.mybatis.basic.entity;

import java.io.Serializable;
import java.util.List;

import com.github.pagehelper.Page;

public class EasyuiList<T> implements Serializable{

	private static final long serialVersionUID = 8656597559014685635L;
	//总记录数
	private Long total;
	//每页显示记录数
	private List<T> rows;    //结果集

	public EasyuiList(List<T> list){
		if (list instanceof Page) {
            Page<T> page = (Page<T>) list;
            this.total = page.getTotal();
            this.rows = page;
        }
	}

	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}

	public List<T> getRows() {
		return rows;
	}
	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	@Override
	public String toString() {
		return "EasyuiList [total=" + total + ", rows=" + rows + "]";
	}
}
